package com.example.stsg.controller;

import com.example.stsg.domain.Signup;
import com.example.stsg.domain.Users;
import com.example.stsg.service.UserService;
import com.example.stsg.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@CrossOrigin
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;

    @PostMapping("/signup")
    public Result signup(@RequestBody Signup signup) {
//        System.out.println(signup.toString());
        return userService.signup(signup);
    }

    @PostMapping("/signin")
    public Result signin(@RequestBody Users users) {
        System.out.println(users.toString());
        return userService.signin(users);
    }
}
